package com.bblocks.common.anti_reptile.interceptor;

import com.bblocks.common.anti_reptile.config.bean.RuleComm;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * <p>Project: bb-anti-reptile - AbstractAntiInterceptor</p>
 * <p>描述：</p>
 *
 * @Author Zhao [125043150@qq.com]
 * @Date 2024/4/2 11:20
 * @Version 1.0
 * @since 8
 */
public abstract class AbstractAntiInterceptor implements HandlerInterceptor {

    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        return this.doPreHandle(request,response,handler);
    }

    /**
     * 执行
     * @param request
     * @param response
     * @param handler
     * @return
     */
    public abstract boolean doPreHandle(HttpServletRequest request, HttpServletResponse response,Object handler) throws Exception ;

    /**
     * 规则优先级(越小优先级越高)
     * @return 优先级
     */
    public abstract int getOrder();
}
